package com.leyou.common.config;


import org.springframework.boot.autoconfigure.data.redis.RedisProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

@Configuration
public class RedisConfig {

    @Bean
    @Primary   //按这个来，不加会报两个RedisProperties错误
    public RedisProperties redisProperties() {
        //新建一个
        RedisProperties redisProperties = new RedisProperties();
        //设置host，ly-redis
        redisProperties.setHost("ly-redis");
        //返回
        return redisProperties;
    }
}
